#include "glare.d3d11.GpuResourceFactory.h"
#include "glare.d3d11.GpuBuffer.h"
#include "glare.d3d11.Texture.h"
#include "glare.d3d11.Driver.h"
#include "glare.d3d11.ShaderResourceView.h"

namespace Glare {

	D3D11GpuResourceFactory::D3D11GpuResourceFactory(D3D11Driver* driver) 
		: _driver(driver)
	{

	}

	GpuBuffer* D3D11GpuResourceFactory::CreateBuffer(const GpuBufferDescription& description)
	{
		return new D3D11GpuBuffer(this, description);
	}

	Texture* D3D11GpuResourceFactory::CreateTexture(const TextureDescription& description)
	{
		return new D3D11Texture(this, description);
	}

	ShaderResourceView* D3D11GpuResourceFactory::CreateShaderResourceView(GpuResource* resource, const ShaderResourceViewDescription& description)
	{
		D3D11GpuResourceInterface* d3d11_interface = static_cast<D3D11GpuResourceInterface*>(resource->_GetInterface());
		return new D3D11ShaderResourceView(this, d3d11_interface, description);
	}

	Driver* D3D11GpuResourceFactory::GetDriver() const
	{
		return _driver;
	}

	D3D11Driver* D3D11GpuResourceFactory::GetD3DDriver() const
	{
		return _driver;
	}
}
